package day8;

import java.util.ArrayList;
import java.util.Random;

public class TestRundom1 {
	public static void main(String[] args) {
		Random r = new Random();
		ArrayList list = new ArrayList();
		boolean flag = true;
		// 22ѡ5
		while(list.size()!=5) {
			int m = r.nextInt(5);

			if (!list.contains(m)) {
				list.add(m);

			}
		}
		System.out.println(list);
	}
}
